const fs = require('fs')


module.exports = (app) => {
    fs.readdirSync(__dirname).forEach(file => {
        if (file === 'index.js') {
            return;
        }
        fs.readdirSync(__dirname + "/" + file).forEach(r => {
            const route = require(`./${file}/${r}`)
            app.use(route.routes()).use(route.allowedMethods())
        })


    });
}
